import smtplib
from email.mime.text import MIMEText
from email.utils import formataddr

msg = MIMEText('我喜欢你','plain','utf-8')
msg['From'] = formataddr(["张宝成",'zhb2879503947@vip.qq.com'])
msg['to'] = formataddr(["小号",'3120166585@qq.com'])
msg['Subject'] = "测试"

server = smtplib.SMTP("smtp.qq.com",465)
server.login("zhb2879503947@vip.qq.com","zhang20020208")
server.sendmail('zhb2879503947@vip.qq.com',['3120166585@qq.com',], msg.as_string())
server.quit()
#这个应该那个验证的问题，试了很多次都有问题